<template>
  <view
    class="mask-layer"
    :style="maskLaeyStyle"
    @tap="$emit('update:visible', false)"
  />
</template>

<script>
export default {
  name: "MaskLayer",
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
  },
  computed: {
    maskLaeyStyle() {
      return {
        opacity: this.visible ? 1 : 0,
        zIndex: this.visible ? 10070 : -100,
      };
    },
  },
};
</script>

<style lang="scss" scoped>
.mask-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  margin: auto;
  z-index: 10070;
  transition: 0.8s;
  transition-timing-function: "ease";
  background-color: rgba(0, 0, 0, 0.5);
}
</style>
